interface columnData {
  title: string
  dataIndex: string
  className?: string
  customRender?: (text: any, record: any, index: number) => any
}

export const columns: Array<columnData> = [
  {
    title: '字段名称',
    dataIndex: 'fieldName'
  },
  {
    title: '字段类型',
    dataIndex: 'fieldType',
    customRender: ({ text }) => {
      return fieldTypeEnum[text]
    }
  },
  {
    title: '是否必填',
    dataIndex: 'required',
    customRender: ({ text }) => {
      return requiredEnum[text]
    }
  },
  {
    title: '字段长度',
    dataIndex: 'fieldLength'
  },
  {
    title: '是否系统字段',
    dataIndex: 'sysType',
    customRender: ({ text }) => {
      return sysTypeEnum[text]
    }
  },
  {
    title: '创建人',
    dataIndex: 'createName',
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
  },
  {
    title: '更新人',
    dataIndex: 'updateName',
  },
  {
    title: '更新时间',
    dataIndex: 'updateTime',
  },
  {
    title: '操作',
    dataIndex: 'operate'
  }
]

//0-PHONE 1-STRING 2-LONG 3-FLOAT 4-INTEGER 5-BOOLEAN 6-EMAIL
export const fieldTypeEnum: Record<number, string> = {
  0: '电话',
  1: '字符串',
  2: '长整型',
  3: '浮点型',
  4: '整型',
  5: '布尔型',
  6: '邮箱'
}

//是否必填 0-非必填 1-必填
export const requiredEnum: Record<number, string> = {
  0: '非必填',
  1: '必填'
}

//是否系统字段 0-系统字段 1-自定义字段
export const sysTypeEnum: Record<number, string> = {
  0: '系统字段',
  1: '自定义字段'
}